package com.theatre.userservice.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("script")
public class Script {

    @TableId(type = IdType.AUTO)
    @Schema(description = "剧本ID")
    private Long id;

    @TableField("title")
    @Schema(description = "标题")
    private String title;

    @TableField("author")
    @Schema(description = "作者")
    private String author;

    @TableField ("publisher_name")
    @Schema(description = "出版社")
    private String publishName;

    @TableField("publication_date")
    @Schema(description = "出版日期")
    private String publishDate;

    @TableField("description")
    @Schema(description = "简介")
    private String description;

    @TableField("content_file")
    @Schema(description = "剧本文件路径")
    private String contentFile;

    @TableField("publisher_id")
    @Schema(description = "所属发行商ID")
    private Long publisherId;

    @TableField("shop_id")
    @Schema(description = "购买店铺ID（可空）")
    private Long shopId;

    @TableField("category_id")
    @Schema(description = "分类ID")
    private Long categoryId;

    @TableField("price")
    @Schema(description = "价格")
    private BigDecimal price;

    @TableField("status")
    @Schema(description = "审核状态：0待审 1通过 2拒绝", allowableValues = {"0", "1", "2"})
    private Integer status;

    @TableField("sold")
    @Schema(description = "是否已卖出：0否 1是", allowableValues = {"0", "1"})
    private Integer sold;

    @TableField("usage_days")
    @Schema(description = "使用期限",defaultValue = "30")
    private Integer usageDays;

    @TableField("expire_time")
    @Schema(description = "过期时间")
    private LocalDateTime expireTime;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;
}
